

<!DOCTYPE html>
<html lang="zh-CN" data-default-color-scheme=&#34;auto&#34;>



<head>
  <meta charset="UTF-8">
  <link rel="apple-touch-icon" sizes="76x76" href="/img/favicon.png">
  <link rel="icon" href="/img/touxiang.jpg">
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, shrink-to-fit=no">
  <meta http-equiv="x-ua-compatible" content="ie=edge">
  
  <meta name="theme-color" content="#2f4154">
  
    <meta name="description" content="">
  
  <meta name="author" content="lc">
  <meta name="keywords" content="">
  
  <title>hexo的美化 - Long</title>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/css/bootstrap.min.css" />


  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/github-markdown-css@4.0.0/github-markdown.min.css" />
  <link  rel="stylesheet" href="/lib/hint/hint.min.css" />

  
    
    
      
      <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/highlight.js@10.4.0/styles/github-gist.min.css" />
    
  

  
    <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.css" />
  



<!-- 主题依赖的图标库，不要自行修改 -->

<link rel="stylesheet" href="//at.alicdn.com/t/font_1749284_ba1fz6golrf.css">



<link rel="stylesheet" href="//at.alicdn.com/t/font_1736178_kmeydafke9r.css">


<link  rel="stylesheet" href="/css/main.css" />

<!-- 自定义样式保持在最底部 -->


  <script id="fluid-configs">
    var Fluid = window.Fluid || {};
    var CONFIG = {"hostname":"lcbc6.github.io","root":"/","version":"1.8.8","typing":{"enable":true,"typeSpeed":70,"cursorChar":"_","loop":false},"anchorjs":{"enable":true,"element":"h1,h2,h3,h4,h5,h6","placement":"right","visible":"hover","icon":""},"progressbar":{"enable":true,"height_px":3,"color":"#29d","options":{"showSpinner":false,"trickleSpeed":100}},"copy_btn":true,"image_zoom":{"enable":true},"toc":{"enable":true,"headingSelector":"h1,h2,h3,h4,h5,h6","collapseDepth":0},"lazyload":{"enable":true,"onlypost":false},"web_analytics":{"enable":false,"baidu":null,"google":null,"gtag":null,"tencent":{"sid":null,"cid":null},"woyaola":null,"cnzz":null,"leancloud":{"app_id":null,"app_key":null,"server_url":null}}};
  </script>
  <script  src="/js/utils.js" ></script>
  <script  src="/js/color-schema.js" ></script>
<meta name="generator" content="Hexo 5.4.0"></head>


<body>
  <header style="height: 70vh;">
    <nav id="navbar" class="navbar fixed-top  navbar-expand-lg navbar-dark scrolling-navbar">
  <div class="container">
    <a class="navbar-brand"
       href="/">&nbsp;<strong>LC</strong>&nbsp;</a>

    <button id="navbar-toggler-btn" class="navbar-toggler" type="button" data-toggle="collapse"
            data-target="#navbarSupportedContent"
            aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
      <div class="animated-icon"><span></span><span></span><span></span></div>
    </button>

    <!-- Collapsible content -->
    <div class="collapse navbar-collapse" id="navbarSupportedContent">
      <ul class="navbar-nav ml-auto text-center">
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/">
                <i class="iconfont icon-home-fill"></i>
                首页
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/archives/">
                <i class="iconfont icon-archive-fill"></i>
                归档
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/categories/">
                <i class="iconfont icon-category-fill"></i>
                分类
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/about/">
                <i class="iconfont icon-user-fill"></i>
                关于
              </a>
            </li>
          
        
          
          
          
          
            <li class="nav-item">
              <a class="nav-link" href="/links/">
                <i class="iconfont icon-link-fill"></i>
                友链
              </a>
            </li>
          
        
        
          <li class="nav-item" id="search-btn">
            <a class="nav-link" data-toggle="modal" data-target="#modalSearch">&nbsp;<i
                class="iconfont icon-search"></i>&nbsp;</a>
          </li>
        
        
          <li class="nav-item" id="color-toggle-btn">
            <a class="nav-link" href="javascript:">&nbsp;<i
                class="iconfont icon-dark" id="color-toggle-icon"></i>&nbsp;</a>
          </li>
        
      </ul>
    </div>
  </div>
</nav>

    <div class="banner" id="banner" parallax=true
         style="background: url('/img/t.jpg') no-repeat center center;
           background-size: cover;">
      <div class="full-bg-img">
        <div class="mask flex-center" style="background-color: rgba(0, 0, 0, 0.3)">
          <div class="page-header text-center fade-in-up">
            <span class="h2" id="subtitle" title="hexo的美化">
              
            </span>

            
              <div class="mt-3">
  
  
    <span class="post-meta">
      <i class="iconfont icon-date-fill" aria-hidden="true"></i>
      <time datetime="2021-02-22 23:31" pubdate>
        2021年2月22日 晚上
      </time>
    </span>
  
</div>

<div class="mt-1">
  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-chart"></i>
      3.1k 字
    </span>
  

  
    
    <span class="post-meta mr-2">
      <i class="iconfont icon-clock-fill"></i>
      
      
      60
       分钟
    </span>
  

  
  
    
      <!-- 不蒜子统计文章PV -->
      <span id="busuanzi_container_page_pv" style="display: none">
        <i class="iconfont icon-eye" aria-hidden="true"></i>
        <span id="busuanzi_value_page_pv"></span> 次
      </span>
    
  
</div>

            
          </div>

          
        </div>
      </div>
    </div>
  </header>

  <main>
    
      

<div class="container-fluid nopadding-x">
  <div class="row nomargin-x">
    <div class="d-none d-lg-block col-lg-2"></div>
    <div class="col-lg-8 nopadding-x-md">
      <div class="container nopadding-x-md" id="board-ctn">
        <div class="py-5" id="board">
          <article class="post-content mx-auto">
            <!-- SEO header -->
            <h1 style="display: none">hexo的美化</h1>
            
            <div class="markdown-body">
              <p>1、添加鼠标点击特效</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br></pre></td><td class="code"><pre><code class="hljs bash">onload = <span class="hljs-function"><span class="hljs-title">function</span></span>() &#123;<br>    var click_cnt = 0;<br>    var <span class="hljs-variable">$html</span> = document.getElementsByTagName(<span class="hljs-string">&quot;html&quot;</span>)[0];<br>    var <span class="hljs-variable">$body</span> = document.getElementsByTagName(<span class="hljs-string">&quot;body&quot;</span>)[0];<br>    <br>    <span class="hljs-variable">$html</span>.onclick = <span class="hljs-keyword">function</span>(e) &#123;<br>    var <span class="hljs-variable">$elem</span> = document.createElement(<span class="hljs-string">&quot;b&quot;</span>);<br>    <span class="hljs-variable">$elem</span>.style.color = <span class="hljs-string">&quot;#E94F06&quot;</span>;<br>    <span class="hljs-variable">$elem</span>.style.zIndex = 9999;<br>    <span class="hljs-variable">$elem</span>.style.position = <span class="hljs-string">&quot;absolute&quot;</span>;<br>    <span class="hljs-variable">$elem</span>.style.select = <span class="hljs-string">&quot;none&quot;</span>;<br>    var x = e.pageX;<br>    var y = e.pageY;<br>    <span class="hljs-variable">$elem</span>.style.left = (x - 10) + <span class="hljs-string">&quot;px&quot;</span>;<br>    <span class="hljs-variable">$elem</span>.style.top = (y - 20) + <span class="hljs-string">&quot;px&quot;</span>;<br>    clearInterval(anim);<br>    switch (++click_cnt) &#123;<br>     <span class="hljs-keyword">case</span> 10:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;OωO&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 20:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;(๑•́ ∀ •̀๑)&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 30:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;(๑•́ ₃ •̀๑)&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 40:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;(๑•̀_•́๑)&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 50:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;（￣へ￣）&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 60:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;(╯°口°)╯(┴—┴&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 70:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;૮( ᵒ̌皿ᵒ̌ )ა&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 80:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;╮(｡&gt;口&lt;｡)╭&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 90:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     <span class="hljs-keyword">case</span> 100:<br>     <span class="hljs-keyword">case</span> 101:<br>     <span class="hljs-keyword">case</span> 102:<br>     <span class="hljs-keyword">case</span> 103:<br>     <span class="hljs-keyword">case</span> 104:<br>     <span class="hljs-keyword">case</span> 105:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;(ꐦ°᷄д°᷅)&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>     default:<br>     <span class="hljs-variable">$elem</span>.innerText = <span class="hljs-string">&quot;❤&quot;</span>;<br>     <span class="hljs-built_in">break</span>;<br>    &#125;<br>    <span class="hljs-variable">$elem</span>.style.fontSize = Math.random() * 10 + 8 + <span class="hljs-string">&quot;px&quot;</span>;<br>    var increase = 0;<br>    var anim;<br>    setTimeout(<span class="hljs-function"><span class="hljs-title">function</span></span>() &#123;<br>     anim = setInterval(<span class="hljs-function"><span class="hljs-title">function</span></span>() &#123;<br>     <span class="hljs-keyword">if</span> (++increase == 150) &#123;<br>      clearInterval(anim);<br>      <span class="hljs-variable">$body</span>.removeChild(<span class="hljs-variable">$elem</span>);<br>     &#125;<br>     <span class="hljs-variable">$elem</span>.style.top = y - 20 - increase + <span class="hljs-string">&quot;px&quot;</span>;<br>     <span class="hljs-variable">$elem</span>.style.opacity = (150 - increase) / 120;<br>     &#125;, 8);<br>    &#125;, 70);<br>    <span class="hljs-variable">$body</span>.appendChild(<span class="hljs-variable">$elem</span>);<br>    &#125;;<br>   &#125;;<br></code></pre></td></tr></table></figure>
<p>2、添加音乐</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><code class="hljs bash">&lt;iframe frameborder=<span class="hljs-string">&quot;yes&quot;</span> border=<span class="hljs-string">&quot;0&quot;</span> marginwidth=<span class="hljs-string">&quot;0&quot;</span> marginheight=<span class="hljs-string">&quot;0&quot;</span> width=330 height=86 <br>src=<span class="hljs-string">&quot;//music.163.com/outchain/player?type=2&amp;id=1822538249&amp;auto=1&amp;height=66&quot;</span>&gt;&lt;/iframe&gt;<br></code></pre></td></tr></table></figure>
<p>3、添加樱花特效</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br><span class="line">132</span><br><span class="line">133</span><br><span class="line">134</span><br><span class="line">135</span><br><span class="line">136</span><br><span class="line">137</span><br><span class="line">138</span><br><span class="line">139</span><br><span class="line">140</span><br><span class="line">141</span><br><span class="line">142</span><br><span class="line">143</span><br><span class="line">144</span><br><span class="line">145</span><br><span class="line">146</span><br><span class="line">147</span><br><span class="line">148</span><br><span class="line">149</span><br><span class="line">150</span><br><span class="line">151</span><br><span class="line">152</span><br></pre></td><td class="code"><pre><code class="hljs bash">var stop, staticx;<br>  var img = new Image();<br>  img.src = <span class="hljs-string">&quot;&quot;</span>;<br>  <br>  <span class="hljs-keyword">function</span> Sakura(x, y, s, r, fn) &#123;<br>      this.x = x;<br>      this.y = y;<br>      this.s = s;<br>      this.r = r;<br>      this.fn = fn;<br>  &#125;<br>  Sakura.prototype.draw = <span class="hljs-keyword">function</span> (cxt) &#123;<br>      cxt.save();<br>      var xc = 40 * this.s / 4;<br>      cxt.translate(this.x, this.y);<br>      cxt.rotate(this.r);<br>      cxt.drawImage(img, 0, 0, 40 * this.s, 40 * this.s)<br>      cxt.restore();<br>  &#125;<br>  Sakura.prototype.update = <span class="hljs-function"><span class="hljs-title">function</span></span> () &#123;<br>      this.x = this.fn.x(this.x, this.y);<br>      this.y = this.fn.y(this.y, this.y);<br>      this.r = this.fn.r(this.r);<br>      <span class="hljs-keyword">if</span> (this.x &gt; window.innerWidth || this.x &lt; 0 || this.y &gt; window.innerHeight || this.y &lt; 0) &#123;<br>          this.r = getRandom(<span class="hljs-string">&#x27;fnr&#x27;</span>);<br>          <span class="hljs-keyword">if</span> (Math.random() &gt; 0.4) &#123;<br>              this.x = getRandom(<span class="hljs-string">&#x27;x&#x27;</span>);<br>              this.y = 0;<br>              this.s = getRandom(<span class="hljs-string">&#x27;s&#x27;</span>);<br>              this.r = getRandom(<span class="hljs-string">&#x27;r&#x27;</span>);<br>          &#125; <span class="hljs-keyword">else</span> &#123;<br>              this.x = window.innerWidth;<br>              this.y = getRandom(<span class="hljs-string">&#x27;y&#x27;</span>);<br>              this.s = getRandom(<span class="hljs-string">&#x27;s&#x27;</span>);<br>              this.r = getRandom(<span class="hljs-string">&#x27;r&#x27;</span>);<br>          &#125;<br>      &#125;<br>  &#125;<br>  SakuraList = <span class="hljs-function"><span class="hljs-title">function</span></span> () &#123;<br>      this.list = [];<br>  &#125;<br>  SakuraList.prototype.push = <span class="hljs-keyword">function</span> (sakura) &#123;<br>      this.list.push(sakura);<br>  &#125;<br>  SakuraList.prototype.update = <span class="hljs-function"><span class="hljs-title">function</span></span> () &#123;<br>      <span class="hljs-keyword">for</span> (var i = 0, len = this.list.length; i &lt; len; i++) &#123;<br>          this.list[i].update();<br>      &#125;<br>  &#125;<br>  SakuraList.prototype.draw = <span class="hljs-keyword">function</span> (cxt) &#123;<br>      <span class="hljs-keyword">for</span> (var i = 0, len = this.list.length; i &lt; len; i++) &#123;<br>          this.list[i].draw(cxt);<br>      &#125;<br>  &#125;<br>  SakuraList.prototype.get = <span class="hljs-keyword">function</span> (i) &#123;<br>      <span class="hljs-built_in">return</span> this.list[i];<br>  &#125;<br>  SakuraList.prototype.size = <span class="hljs-function"><span class="hljs-title">function</span></span> () &#123;<br>      <span class="hljs-built_in">return</span> this.list.length;<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> getRandom(option) &#123;<br>      var ret, random;<br>      switch (option) &#123;<br>          <span class="hljs-keyword">case</span> <span class="hljs-string">&#x27;x&#x27;</span>:<br>              ret = Math.random() * window.innerWidth;<br>              <span class="hljs-built_in">break</span>;<br>          <span class="hljs-keyword">case</span> <span class="hljs-string">&#x27;y&#x27;</span>:<br>              ret = Math.random() * window.innerHeight;<br>              <span class="hljs-built_in">break</span>;<br>          <span class="hljs-keyword">case</span> <span class="hljs-string">&#x27;s&#x27;</span>:<br>              ret = Math.random();<br>              <span class="hljs-built_in">break</span>;<br>          <span class="hljs-keyword">case</span> <span class="hljs-string">&#x27;r&#x27;</span>:<br>              ret = Math.random() * 6;<br>              <span class="hljs-built_in">break</span>;<br>          <span class="hljs-keyword">case</span> <span class="hljs-string">&#x27;fnx&#x27;</span>:<br>              random = -0.5 + Math.random() * 1;<br>              ret = <span class="hljs-keyword">function</span> (x, y) &#123;<br>                  <span class="hljs-built_in">return</span> x + 0.5 * random - 1.7;<br>              &#125;;<br>              <span class="hljs-built_in">break</span>;<br>          <span class="hljs-keyword">case</span> <span class="hljs-string">&#x27;fny&#x27;</span>:<br>              random = 1.5 + Math.random() * 0.7<br>              ret = <span class="hljs-keyword">function</span> (x, y) &#123;<br>                  <span class="hljs-built_in">return</span> y + random;<br>              &#125;;<br>              <span class="hljs-built_in">break</span>;<br>          <span class="hljs-keyword">case</span> <span class="hljs-string">&#x27;fnr&#x27;</span>:<br>              random = Math.random() * 0.03;<br>              ret = <span class="hljs-keyword">function</span> (r) &#123;<br>                  <span class="hljs-built_in">return</span> r + random;<br>              &#125;;<br>              <span class="hljs-built_in">break</span>;<br>      &#125;<br>      <span class="hljs-built_in">return</span> ret;<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">startSakura</span></span>() &#123;<br>      requestAnimationFrame = window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame;<br>      var canvas = document.createElement(<span class="hljs-string">&#x27;canvas&#x27;</span>),<br>          cxt;<br>      staticx = <span class="hljs-literal">true</span>;<br>      canvas.height = window.innerHeight;<br>      canvas.width = window.innerWidth;<br>      canvas.setAttribute(<span class="hljs-string">&#x27;style&#x27;</span>, <span class="hljs-string">&#x27;position: fixed;left: 0;top: 0;pointer-events: none;&#x27;</span>);<br>      canvas.setAttribute(<span class="hljs-string">&#x27;id&#x27;</span>, <span class="hljs-string">&#x27;canvas_sakura&#x27;</span>);<br>      document.getElementsByTagName(<span class="hljs-string">&#x27;body&#x27;</span>)[0].appendChild(canvas);<br>      cxt = canvas.getContext(<span class="hljs-string">&#x27;2d&#x27;</span>);<br>      var sakuraList = new SakuraList();<br>      <span class="hljs-keyword">for</span> (var i = 0; i &lt; 50; i++) &#123;<br>          var sakura, randomX, randomY, randomS, randomR, randomFnx, randomFny;<br>          randomX = getRandom(<span class="hljs-string">&#x27;x&#x27;</span>);<br>          randomY = getRandom(<span class="hljs-string">&#x27;y&#x27;</span>);<br>          randomR = getRandom(<span class="hljs-string">&#x27;r&#x27;</span>);<br>          randomS = getRandom(<span class="hljs-string">&#x27;s&#x27;</span>);<br>          randomFnx = getRandom(<span class="hljs-string">&#x27;fnx&#x27;</span>);<br>          randomFny = getRandom(<span class="hljs-string">&#x27;fny&#x27;</span>);<br>          randomFnR = getRandom(<span class="hljs-string">&#x27;fnr&#x27;</span>);<br>          sakura = new Sakura(randomX, randomY, randomS, randomR, &#123;<br>              x: randomFnx,<br>              y: randomFny,<br>              r: randomFnR<br>          &#125;);<br>          sakura.draw(cxt);<br>          sakuraList.push(sakura);<br>      &#125;<br>      stop = requestAnimationFrame(<span class="hljs-function"><span class="hljs-title">function</span></span> () &#123;<br>          cxt.clearRect(0, 0, canvas.width, canvas.height);<br>          sakuraList.update();<br>          sakuraList.draw(cxt);<br>          stop = requestAnimationFrame(arguments.callee);<br>      &#125;)<br>  &#125;<br>  window.onresize = <span class="hljs-function"><span class="hljs-title">function</span></span> () &#123;<br>      var canvasSnow = document.getElementById(<span class="hljs-string">&#x27;canvas_snow&#x27;</span>);<br>  &#125;<br>  img.onload = <span class="hljs-function"><span class="hljs-title">function</span></span> () &#123;<br>      startSakura();<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">stopp</span></span>() &#123;<br>      <span class="hljs-keyword">if</span> (staticx) &#123;<br>          var child = document.getElementById(<span class="hljs-string">&quot;canvas_sakura&quot;</span>);<br>          child.parentNode.removeChild(child);<br>          window.cancelAnimationFrame(stop);<br>          staticx = <span class="hljs-literal">false</span>;<br>      &#125; <span class="hljs-keyword">else</span> &#123;<br>          startSakura();<br>      &#125;<br>  &#125; <br><br></code></pre></td></tr></table></figure>
<p>4、添加鼠标移动特效</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br></pre></td><td class="code"><pre><code class="hljs bash"><br> (<span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">fairyDustCursor</span></span>() &#123;<br><br>  var possibleColors = [<span class="hljs-string">&quot;#D61C59&quot;</span>, <span class="hljs-string">&quot;#E7D84B&quot;</span>, <span class="hljs-string">&quot;#1B8798&quot;</span>]<br>  var width = window.innerWidth;<br>  var height = window.innerHeight;<br>  var cursor = &#123;x: width/2, y: width/2&#125;;<br>  var particles = [];<br>  <br>  <span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">init</span></span>() &#123;<br>    bindEvents();<br>    loop();<br>  &#125;<br>  <br>  // Bind events that are needed<br>  <span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">bindEvents</span></span>() &#123;<br>    document.addEventListener(<span class="hljs-string">&#x27;mousemove&#x27;</span>, onMouseMove);<br>    document.addEventListener(<span class="hljs-string">&#x27;touchmove&#x27;</span>, onTouchMove);<br>    document.addEventListener(<span class="hljs-string">&#x27;touchstart&#x27;</span>, onTouchMove);<br>    <br>    window.addEventListener(<span class="hljs-string">&#x27;resize&#x27;</span>, onWindowResize);<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> onWindowResize(e) &#123;<br>    width = window.innerWidth;<br>    height = window.innerHeight;<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> onTouchMove(e) &#123;<br>    <span class="hljs-keyword">if</span>( e.touches.length &gt; 0 ) &#123;<br>      <span class="hljs-keyword">for</span>( var i = 0; i &lt; e.touches.length; i++ ) &#123;<br>        addParticle( e.touches[i].clientX, e.touches[i].clientY, possibleColors[Math.floor(Math.random()*possibleColors.length)]);<br>      &#125;<br>    &#125;<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> onMouseMove(e) &#123;    <br>    cursor.x = e.clientX;<br>    cursor.y = e.clientY;<br>    <br>    addParticle( cursor.x, cursor.y, possibleColors[Math.floor(Math.random()*possibleColors.length)]);<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> addParticle(x, y, color) &#123;<br>    var particle = new Particle();<br>    particle.init(x, y, color);<br>    particles.push(particle);<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">updateParticles</span></span>() &#123;<br>    <br>    <span class="hljs-keyword">for</span>( var i = 0; i &lt; particles.length; i++ ) &#123;<br>      particles[i].update();<br>    &#125;<br>    <br>    <span class="hljs-keyword">for</span>( var i = particles.length -1; i &gt;= 0; i-- ) &#123;<br>      <span class="hljs-keyword">if</span>( particles[i].lifeSpan &lt; 0 ) &#123;<br>        particles[i].die();<br>        particles.splice(i, 1);<br>      &#125;<br>    &#125;<br>    <br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">loop</span></span>() &#123;<br>    requestAnimationFrame(loop);<br>    updateParticles();<br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">Particle</span></span>() &#123;<br><br>    this.character = <span class="hljs-string">&quot;*&quot;</span>;<br>    this.lifeSpan = 200; //ms<br>    this.initialStyles =&#123;<br>      <span class="hljs-string">&quot;position&quot;</span>: <span class="hljs-string">&quot;fixed&quot;</span>,<br>      <span class="hljs-string">&quot;top&quot;</span>: <span class="hljs-string">&quot;0&quot;</span>, //必须加<br>      <span class="hljs-string">&quot;display&quot;</span>: <span class="hljs-string">&quot;block&quot;</span>,<br>      <span class="hljs-string">&quot;pointerEvents&quot;</span>: <span class="hljs-string">&quot;none&quot;</span>,<br>      <span class="hljs-string">&quot;z-index&quot;</span>: <span class="hljs-string">&quot;10000000&quot;</span>,<br>      <span class="hljs-string">&quot;fontSize&quot;</span>: <span class="hljs-string">&quot;20px&quot;</span>,<br>      <span class="hljs-string">&quot;will-change&quot;</span>: <span class="hljs-string">&quot;transform&quot;</span><br>    &#125;;<br><br>    this.init = <span class="hljs-keyword">function</span>(x, y, color) &#123;<br><br>      this.velocity = &#123;<br>        x:  (Math.random() &lt; 0.5 ? -1 : 1) * (Math.random() / 2),<br>        y: 1<br>      &#125;;<br>      <br>      this.position = &#123;x: x - 10, y: y - 20&#125;;<br>      this.initialStyles.color = color;<br>      console.log(color);<br><br>      this.element = document.createElement(<span class="hljs-string">&#x27;span&#x27;</span>);<br>      this.element.innerHTML = this.character;<br>      applyProperties(this.element, this.initialStyles);<br>      this.update();<br>      <br>      document.body.appendChild(this.element);<br>    &#125;;<br>    <br>    this.update = <span class="hljs-function"><span class="hljs-title">function</span></span>() &#123;<br>      this.position.x += this.velocity.x;<br>      this.position.y += this.velocity.y;<br>      this.lifeSpan--;<br>      <br>      this.element.style.transform = <span class="hljs-string">&quot;translate3d(&quot;</span> + this.position.x + <span class="hljs-string">&quot;px,&quot;</span> + this.position.y + <span class="hljs-string">&quot;px,0) scale(&quot;</span> + (this.lifeSpan / 120) + <span class="hljs-string">&quot;)&quot;</span>;<br>    &#125;<br>    <br>    this.die = <span class="hljs-function"><span class="hljs-title">function</span></span>() &#123;<br>      this.element.parentNode.removeChild(this.element);<br>    &#125;<br>    <br>  &#125;<br>  <br>  <span class="hljs-keyword">function</span> applyProperties( target, properties ) &#123;<br>    <span class="hljs-keyword">for</span>( var key <span class="hljs-keyword">in</span> properties ) &#123;<br>      target.style[ key ] = properties[ key ];<br>    &#125;<br>  &#125;<br>  <br>  init();<br>&#125;)();<br> <br></code></pre></td></tr></table></figure>
<p>5、添加底部网站运行时间</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><code class="hljs bash">// 网页计时js<br>!(<span class="hljs-function"><span class="hljs-title">function</span></span>() &#123;<br>    <span class="hljs-keyword">function</span> <span class="hljs-function"><span class="hljs-title">update</span></span>() &#123;<br>      var now = new Date();<br>      var grt = new Date(<span class="hljs-string">&quot;2021-02-22 13:33:48&quot;</span>);  /** 此处是计时的起始时间 **/<br>      now.setTime(now.getTime()+250);<br>      days = (now - grt ) / 1000 / 60 / 60 / 24;<br>      dnum = Math.floor(days);<br>      hours = (now - grt ) / 1000 / 60 / 60 - (24 * dnum);<br>      hnum = Math.floor(hours);<br>      <span class="hljs-keyword">if</span>(String(hnum).length === 1 )&#123;<br>        hnum = <span class="hljs-string">&quot;0&quot;</span> + hnum;<br>      &#125;<br>      minutes = (now - grt ) / 1000 /60 - (24 * 60 * dnum) - (60 * hnum);<br>      mnum = Math.floor(minutes);<br>      <span class="hljs-keyword">if</span>(String(mnum).length === 1 )&#123;<br>        mnum = <span class="hljs-string">&quot;0&quot;</span> + mnum;<br>      &#125;<br>      seconds = (now - grt ) / 1000 - (24 * 60 * 60 * dnum) - (60 * 60 * hnum) - (60 * mnum);<br>      snum = Math.round(seconds);<br>      <span class="hljs-keyword">if</span>(String(snum).length === 1 )&#123;<br>        snum = <span class="hljs-string">&quot;0&quot;</span> + snum;<br>      &#125;<br>      document.getElementById(<span class="hljs-string">&quot;timeDate&quot;</span>).innerHTML = <span class="hljs-string">&quot;已运行&amp;nbsp&quot;</span>+dnum+<span class="hljs-string">&quot;&amp;nbsp天&quot;</span>;<br>      document.getElementById(<span class="hljs-string">&quot;times&quot;</span>).innerHTML = hnum + <span class="hljs-string">&quot;&amp;nbsp小时&amp;nbsp&quot;</span> + mnum + <span class="hljs-string">&quot;&amp;nbsp分&amp;nbsp&quot;</span> + snum + <span class="hljs-string">&quot;&amp;nbsp秒&quot;</span>;<br>    &#125;<br>    setInterval(update, 1000);<br>  &#125;)();<br></code></pre></td></tr></table></figure>
            </div>
            <hr>
            <div>
              <div class="post-metas mb-3">
                
                  <div class="post-meta mr-3">
                    <i class="iconfont icon-category"></i>
                    
                      <a class="hover-with-bg" href="/categories/hexo/">hexo</a>
                    
                  </div>
                
                
              </div>
              
                <p class="note note-warning">
                  
                    本博客所有文章除特别声明外，均采用 <a target="_blank" href="https://creativecommons.org/licenses/by-sa/4.0/deed.zh" rel="nofollow noopener noopener">CC BY-SA 4.0 协议</a> ，转载请注明出处！
                  
                </p>
              
              
                <div class="post-prevnext">
                  <article class="post-prev col-6">
                    
                    
                      <a href="/2021/02/22/git/">
                        <i class="iconfont icon-arrowleft"></i>
                        <span class="hidden-mobile">git上传</span>
                        <span class="visible-mobile">上一篇</span>
                      </a>
                    
                  </article>
                  <article class="post-next col-6">
                    
                    
                      <a href="/2021/02/22/Linux/">
                        <span class="hidden-mobile">Linux的学习</span>
                        <span class="visible-mobile">下一篇</span>
                        <i class="iconfont icon-arrowright"></i>
                      </a>
                    
                  </article>
                </div>
              
            </div>

            
          </article>
        </div>
      </div>
    </div>
    
      <div class="d-none d-lg-block col-lg-2 toc-container" id="toc-ctn">
        <div id="toc">
  <p class="toc-header"><i class="iconfont icon-list"></i>&nbsp;目录</p>
  <div class="toc-body" id="toc-body"></div>
</div>

      </div>
    
  </div>
</div>

<!-- Custom -->


    

    
      <a id="scroll-top-button" href="#" role="button">
        <i class="iconfont icon-arrowup" aria-hidden="true"></i>
      </a>
    

    
      <div class="modal fade" id="modalSearch" tabindex="-1" role="dialog" aria-labelledby="ModalLabel"
     aria-hidden="true">
  <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header text-center">
        <h4 class="modal-title w-100 font-weight-bold">搜索</h4>
        <button type="button" id="local-search-close" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
      <div class="modal-body mx-3">
        <div class="md-form mb-5">
          <input type="text" id="local-search-input" class="form-control validate">
          <label data-error="x" data-success="v"
                 for="local-search-input">关键词</label>
        </div>
        <div class="list-group" id="local-search-result"></div>
      </div>
    </div>
  </div>
</div>
    

    
  </main>

  <footer class="text-center mt-5 py-3">
  <input type="hidden" name="测试是不是真的发布到了网站上">
  <iframe frameborder="yes" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=1822538249&auto=1&height=66"></iframe>
  <div class="footer-content">
     <div> <span id="timeDate">载入天数...</span> <span id="times">载入时分秒...</span> <script src="/js/duration.js"></script> </div> <a href="https://hexo.io" target="_blank" rel="nofollow noopener"><span>Hexo</span></a> <i class="iconfont icon-love"></i> <a href="https://github.com/fluid-dev/hexo-theme-fluid" target="_blank" rel="nofollow noopener"><span>Fluid</span></a>

  </div>
  

  

  
</footer>

<!-- SCRIPTS -->

  <script  src="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.js" ></script>
  <link  rel="stylesheet" href="https://cdn.jsdelivr.net/npm/nprogress@0.2.0/nprogress.min.css" />

  <script>
    NProgress.configure({"showSpinner":false,"trickleSpeed":100})
    NProgress.start()
    window.addEventListener('load', function() {
      NProgress.done();
    })
  </script>


<script  src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" ></script>
<script  src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.min.js" ></script>
<script  src="/js/debouncer.js" ></script>
<script  src="/js/events.js" ></script>
<script  src="/js/plugins.js" ></script>

<!-- Plugins -->


  
    <script  src="/js/lazyload.js" ></script>
  



  



  <script  src="https://cdn.jsdelivr.net/npm/tocbot@4.12.0/dist/tocbot.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@3.5.7/dist/jquery.fancybox.min.js" ></script>



  <script  src="https://cdn.jsdelivr.net/npm/anchor-js@4.3.0/anchor.min.js" ></script>



  <script defer src="https://cdn.jsdelivr.net/npm/clipboard@2.0.6/dist/clipboard.min.js" ></script>



  <script defer src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js" ></script>




  <script  src="https://cdn.jsdelivr.net/npm/typed.js@2.0.11/lib/typed.min.js" ></script>
  <script>
    (function (window, document) {
      var typing = Fluid.plugins.typing;
      var title = document.getElementById('subtitle').title;
      
      typing(title)
      
    })(window, document);
  </script>



  <script  src="/js/local-search.js" ></script>
  <script>
    (function () {
      var path = "/local-search.xml";
      $('#local-search-input').on('click', function() {
        searchFunc(path, 'local-search-input', 'local-search-result');
      });
      $('#modalSearch').on('shown.bs.modal', function() {
        $('#local-search-input').focus();
      });
    })()
  </script>














  
<script src="/js/myjs.js"></script>



<!-- 主题的启动项 保持在最底部 -->
<script  src="/js/boot.js" ></script>


</body>
</html>
